package com.huawei.cloud.phone.management.infrastructure.db.mapper;

import com.huawei.cloud.phone.management.domain.connection.Connection;
import com.huawei.cloud.phone.management.domain.connection.ConnectionStatus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ConnectionMapper {

    int addConnection(Connection connection);

    int updateConnection(Connection connection);

    int updateStatus(@Param("connectionId") String connectionId, @Param("origin") ConnectionStatus origin, @Param("target") ConnectionStatus target);

    List<String> getUsingPhoneIds();

    Connection getConnectionByUserPhone(String userPhoneId);

    Connection getConnectionByPhone(String phoneId);

    void deleteConnection(String userPhoneId);

    int maintainStatus(@Param("origin") ConnectionStatus origin, @Param("target") ConnectionStatus target);
}
